/* Effects Script */
window.addEvent('domready', function () {
	var except = 2;
	var navs = $$('ul.navigation li a');
	
	var active = {
			'color'				: 'FFFFFF',
			'border-left-color'	: '6C2424',
			'background-color'	: '131313',
			'text-indent'	  	: '7px'
		}
	var sleepy = {
			'color'				: 'AAAAAA',
			'background-color'	: '0A0A0A',
			'border-left-color' : '472323'
		}
	var asleep = {
			'border-left-color'	: '131313',
			'background-color'	: '000000',
			'text-indent'		: '0px'
		}
	
	navs.each(function(element, i) {
		var fx = new Fx.Styles(element, {duration:300, wait:false});
	 
		element.addEvent('mouseenter', function(){
			fx.start(active);
		});
	 
		// two phase fade
		element.addEvent('mouseleave', function(){
			fx.start(sleepy).chain(function() {
					fx.start.delay(150, fx, asleep);
				});
		});
	});
	
	
	/*  second level navigation items : slide-outs.
		how it works: knobs toggle drawers
	*/
	var drawers = $$('ul.navigation li ul');
	drawers.each(function(drawer) {
		var knob = drawer.getParent();
		var slideDrawer = new Fx.Slide(drawer);
		slideDrawer.hide();
		
		knob.addEvent('click', function() {
			slideDrawer.toggle();
		});
	});
});